﻿using System;
using System.Collections.Generic;
using System.Text;

namespace ModelSerialize
{
    public class Lock
    {
        private object _lock = new object();

        public Lock() { }

        public Lock(object obj) { _lock = obj; }

        public void Work(Action action)
        {
            lock (_lock)
                action();
        }
    }
}
